using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.ACM
{
    [DataContract, Table("acm_mas_account")]
    public class MasAccount
    {
		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "AccountId", ResourceType = typeof(Resources.MasAccountResource))]
        [Column("account_seq")]
        public int AccountId { get; set; }

		[DataMember, Display(Name = "AccountCode", ResourceType = typeof(Resources.MasAccountResource))]
        [Column("account_code")]
        public string AccountCode { get; set; }

        [ForeignKey("UpperAccount")]
		[DataMember, Display(Name = "UpperAccountId", ResourceType = typeof(Resources.MasAccountResource))]
        [Column("upper_account_seq")]
        public Nullable<int> UpperAccountId { get; set; }

		[DataMember, Display(Name = "AccountName", ResourceType = typeof(Resources.MasAccountResource))]
        [Column("account_name")]
        public string AccountName { get; set; }

		[DataMember, Display(Name = "AccountDescr", ResourceType = typeof(Resources.MasAccountResource))]
        [Column("account_descr")]
        public string AccountDescr { get; set; }

        [ForeignKey("MasAccountVersion")]
        [DataMember, Display(Name = "VersionId", ResourceType = typeof(Resources.MasAccountResource))]
        [Column("version_seq")]
        public Nullable<int> VersionId { get; set; }

        [DataMember]
        public virtual MasAccount UpperAccount { get; set; }

        [DataMember]
        public virtual MasAccountVersion MasAccountVersion { get; set; }

        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("record_status")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_by")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_when")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_by")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_when")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        #endregion

    }
}